﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>改变文本内容</title>
</head>
<body>
    <p id="demo">单击按钮来改变这一段中的文本。</p>
    <button onclick="myFunction()">修改文本</button>
    <script>
        function myFunction() {
            document.getElementById("demo").innerHTML = "Hello JavaScript";
        };

    </script>
</body>
</html>